window.Function.prototype.extend=function(parentClassOrObject)
{try
{if(typeof(parentClassOrObject)=="function")
{if(parentClassOrObject.constructor==Function)
{this.prototype=new parentClassOrObject;this.prototype.constructor=this;this.prototype.parent=parentClassOrObject.prototype;}
else
{this.prototype=parentClassOrObject;this.prototype.constructor=this;this.prototype.parent=parentClassOrObject;}
return this;}}
catch(e)
{if(this.className!=undefined)
alert("Error when extending class : "+this.className+" : "+e);else
alert("Error when extending class : "+this+" : "+e);}}
Date.prototype.DateAdd=function(timeU,byMany,dateObj){var millisecond=1;var second=millisecond*1000;var minute=second*60;var hour=minute*60;var day=hour*24;var year=day*365;var newDate;var dVal=this.valueOf();switch(timeU){case"ms":newDate=new Date(dVal+millisecond*byMany);break;case"s":newDate=new Date(dVal+second*byMany);break;case"mi":newDate=new Date(dVal+minute*byMany);break;case"h":newDate=new Date(dVal+hour*byMany);break;case"d":newDate=new Date(dVal+day*byMany);break;case"y":newDate=new Date(dVal+year*byMany);break;}
return newDate;}
Date.prototype.DateSub=function(timeU,byMany,dateObj){var millisecond=1;var second=millisecond*1000;var minute=second*60;var hour=minute*60;var day=hour*24;var year=day*365;var newDate;var dVal=this.valueOf();switch(timeU){case"ms":newDate=new Date(dVal-millisecond*byMany);break;case"s":newDate=new Date(dVal-second*byMany);break;case"mi":newDate=new Date(dVal-minute*byMany);break;case"h":newDate=new Date(dVal-hour*byMany);break;case"d":newDate=new Date(dVal-day*byMany);break;case"y":newDate=new Date(dVal-year*byMany);break;}
return newDate;}
Date.prototype.getBln=function()
{return this.getMonth()+1;}
Date.prototype.DateDiff=function(dateObj)
{var ret=(this-dateObj)/(24*60*60*1000);return ret;}
Date.prototype.getDateStr=function()
{return this.getFullYear()+"-"+(this.getBln()<10?"0"+this.getBln():this.getBln())+"-"+(this.getDate()<10?"0"+this.getDate():this.getDate());}
Date.prototype.getDateTimeStr=function(nminute)
{var d=this.DateSub("mi",nminute);return d.getFullYear()+"-"+(d.getBln()<10?"0"+d.getBln():d.getBln())+"-"+(d.getDate()<10?"0"+d.getDate():d.getDate())+
d.getHours()+":"+d.getMinutes()+":"+d.getSeconds();}
Date.prototype.idFormat=function(strDate)
{var d=this.strToDate(strDate);return(d.getDate()<10?"0"+d.getDate():d.getDate())+"/"+(d.getBln()<10?"0"+d.getBln():d.getBln())+"/"+d.getFullYear();}
Date.prototype.lclFormat=function()
{var d=this;return(d.getDate()<10?"0"+d.getDate():d.getDate())+"/"+(d.getBln()<10?"0"+d.getBln():d.getBln())+"/"+d.getFullYear();}
Date.prototype.strToDate=function(strDate)
{if(strDate.search("/")!=-1)
{var d=strDate.split("/");var ret=new Date(parseInt(d[2],10),parseInt(d[1],10)-1,parseInt(d[0],10));}else
{var d=strDate.split("-");if(d[0].length==4)
var ret=new Date(parseInt(d[0],10),parseInt(d[1],10)-1,parseInt(d[2],10));else var ret=new Date(parseInt(d[2],10),parseInt(d[1],10)-1,parseInt(d[0],10));}
return ret;}
Date.prototype.sqlDateStr=function(strDate)
{if(strDate.search("/")!=-1)
{var d=strDate.split("/");var ret=parseInt(d[2],10)+"-"+parseInt(d[1],10)+"-"+parseInt(d[0],10);}
return ret;}
function monthName(prd){}
Array.prototype.indexOf=function(v,b,s){for(var i=+b||0,l=this.length;i<l;i++){if(this[i]===v||s&&this[i]==v){return i;}}
return-1;};function nextNPeriode(periode,n)
{var bln=parseInt(periode.substr(5));var thn=parseInt(periode.substr(0,4));for(var i=1;i<=n;i++){if(bln<12)bln++;else{bln=1;thn++;}}
if(bln<10)bln="0"+bln;return thn+""+bln;}
function getPrevPeriode(periode)
{var bln=parseInt(periode.substr(5));var thn=parseInt(periode.substr(0,4));if(bln==1){bln=12;thn--;}else bln--;if(bln<10)bln="0"+bln;return thn+""+bln;}
function getNextPeriode(periode)
{var bln=parseInt(periode.substr(5));var thn=parseInt(periode.substr(0,4));if(bln==12){bln=1;thn++;}else bln++;if(bln<10)bln="0"+bln;return thn+""+bln;}
function closePeriode(periode,maksPeriode){var bln=parseInt(periode.substr(5));var thn=parseInt(periode.substr(0,4));if(bln<0||bln>99)bln=1;if(bln==maksPeriode){bln=1;thn++;}else bln++;if(bln<10)bln="0"+bln;return thn+""+bln;}
function formatNumeric(format,idx)
{var result=idx.toString();for(var i=0;i<format.length;i++)
{if(result.length<format.length)
result="0"+result;}
return result;}
function format_number(value,decLength,decSp,thousSep){if(typeof(value)=="string")return value;var nilai=value.toString();var dec="";if(nilai=="NaN")return 0;if(nilai.search(".")==-1){nilai=floatToNilai(parseFloat(nilai),decSp,thousSep);for(var i=0;i<decLength;i++)
dec+="0";}else{nilai=nilai.replace(".",decSp);nilai=nilai.split(decSp);dec=nilai[1];if(dec==undefined)dec="";for(var i=0;i<decLength;i++)
dec+="0";nilai=floatToNilai(parseFloat(nilai[0]),decSp,thousSep);dec=dec.substr(0,decLength);}
return nilai+decSp+dec;}
function parseNilai(value)
{var nilai=String(RemoveTitik(value));nilai=nilai.replace(",",".");return nilai;}
function isNilai(value)
{if(typeof(value)=="string"){var c=0;for(var i=0;i<value.length;i++)
if(value.charAt(i)==".")c++;if(c>1)return true;else{var tmp=value.split(".");if(tmp[tmp.length-1].length==3&&tmp[0]!="0")
return true;else return false;}}else return false;}
function RemoveTitik(str)
{var num=str;var numtmp="";var i;for(i=0;i<num.length;i++)
{if(num.charAt(i)!=".")
numtmp+=num.charAt(i);}
num=numtmp;return num;}
function decToFloat(value)
{if(typeof(value)!="string")value=value.toString();var nilai=value;nilai=nilai.replace(",",".");return nilai;}
function floatToDec(value)
{if(typeof(value)=="string")value=parseFloat(value);var nilai=value.toString();nilai=nilai.replace(".",",");return nilai;}
function floatToNilai(value,decSep,thousandSep)
{var nilai=floatToDec(value);nilai=decToNilai(nilai,decSep,thousandSep);return nilai;}
function nilaiToFloat(value)
{var nilai=nilaiToDec(value);nilai=decToFloat(nilai);return parseFloat(nilai);}
function nilaiToDec(value)
{var nilai=String(RemoveTitik(value));return nilai;}
function decToNilai(value,decSep,thousandSep)
{var nilai=strToNilai(value,decSep,thousandSep);return nilai;}
function strToNilai(value,decSep,thousandSep)
{try{if(typeof(value)!="string")return floatToNilai(value,decSep,thousandSep);var isMin=value.search("-")!=-1?true:false;if(isMin)
value=value.replace("-","");var decpoint=',';var sep='.';if(decSep!=undefined)decpoint=decSep;if(thousandSep!=undefined)sep=thousandSep;var isExit=0;var num=value;var numtmp="";var i;for(i=0;i<num.length;i++)
{if(num.charAt(i)!=".")
numtmp+=num.charAt(i);}
num=numtmp;num=num.toString();a=num.split(decpoint);x=a[0];y=a[1];z="";if(typeof(x)!="undefined"){for(i=x.length-1;i>=0;i--)
z+=x.charAt(i);z=z.replace(/(\d{3})/g,"$1"+sep);if(z.slice(-sep.length)==sep)
z=z.slice(0,-sep.length);x="";for(i=z.length-1;i>=0;i--)
x+=z.charAt(i);if(typeof(y)!="undefined"&&y.length>0)
x+=decpoint+y;}
if(isMin)
x='-'+x;return x;}catch(e){alert("strToNilai::"+e);}}
function strToFloat(data)
{var nilai=String(RemoveTitik(data));nilai=nilai.replace(",",".");return nilai;}
function ifNull(driver){return(driver=="mysqlt"?"ifnull":"isnull");}
function perform_gradient(startColor,endColor,height,container){var startr=parseInt((startColor[0]+startColor[1]),16);var startg=parseInt((startColor[2]+startColor[3]),16);var startb=parseInt((startColor[4]+startColor[5]),16);var endr=parseInt((endColor[0]+endColor[1]),16);var endg=parseInt((endColor[2]+endColor[3]),16);var endb=parseInt((endColor[4]+endColor[5]),16);var diffr=endr-startr;var diffg=endg-startg;var diffb=endb-startb;var intervalr=0;var intervalg=0;var intervalb=0;var curr=startr;var curg=startg;var curb=startb;var i=0;var gradientTable=container;intervalr=Math.round(diffr/height);intervalg=Math.round(diffg/height);intervalb=Math.round(diffb/height);toPrint="";while(i<height){curr_str=curr.toString(16);if(curr<16){curr_str="0"+curr_str;}
curg_str=curg.toString(16);if(curg<16){curg_str="0"+curg_str;}
curb_str=curb.toString(16);if(curb<16){curb_str="0"+curb_str;}
cur_color="#"+curr_str+curg_str+curb_str;toPrint+="<div style='height: 1px;width: 100%;background-color: "+cur_color+"; padding: 0px; margin: 0px;'><\/div>\n";curr+=intervalr;curg+=intervalg;curb+=intervalb;i++;}
gradientTable.innerHTML+=toPrint;}
function replaceStrBetween(str1,str2,strRep,strObj){var pos1=strObj.indexOf(str1);var pos2=strObj.indexOf(str2);if(pos1==-1)return false;var result=strObj.substr(0,pos1+str1.length)+" "+strRep+" "+strObj.substr(pos2);return result;}
function findPos(form,obj){var curleft=curtop=0;if(obj.offsetParent){curleft=obj.offsetLeft
curtop=obj.offsetTop
while(obj=obj.offsetParent!=form?obj.offsetParent:undefined){curleft+=obj.offsetLeft
curtop+=obj.offsetTop}}
return[curleft,curtop];}
function payment(PV,IR,NP){var PMT=(PV*IR)/(1-Math.pow(1+IR,-NP))
return round_decimals(PMT,2)}
function round_decimals(original_number,decimals){var result1=original_number*Math.pow(10,decimals)
var result2=Math.round(result1)
var result3=result2/Math.pow(10,decimals)
return(result3)}
window.obj1=function()
{window.obj1.prototype.parent.constructor.call(this);this.name="obj1";}
window.obj1.extend(window.Function);window.obj1.prototype.showName=function()
{alert(this.name);}
window.obj2=function()
{window.obj2.prototype.parent.constructor.call(this);this.address="address 2";}
window.obj2.extend(window.obj1);window.obj2.prototype.show=function()
{alert(this.name+" "+this.address);}
function getBasicResourceId()
{var result=window.basicResourceId;window.basicResourceId++;return result;}
function loadCSS(cssfile)
{if(usesHttp!=undefined)
{var script="";usesHttp.open("GET","uses.php?mode=loadCss&filename="+cssfile,false);usesHttp.send("");if(usesHttp.status==200)
script=usesHttp.responseText;return script;}}
function uses(className,alwaysLoad,classFile)
{if(alwaysLoad==undefined)alwaysLoad=false;if(classFile==undefined)classFile=true;var classExist=false;if(usesHttp!=undefined)
{try{var lastPos=className.lastIndexOf("_");var script="";var classExist=false;if(lastPos>0)
{var packageName=className.substring(0,lastPos);if(className.charAt(className.length-1)=='*')
{var params="mode=loadPackage&packageName="+packageName;usesHttp.open("GET","uses.php?mode=loadPackage&packageName="+packageName,false);usesHttp.send("");if(usesHttp.status==200)
{script=usesHttp.responseText;try
{eval("try { "+script+" } catch (e2) {}");}
catch(e)
{alert(e);}}}
else
{try
{if(classFile){var script="try {classExist = ("+className+" != undefined); } catch (e) {classExist = false;}";eval(script);}}
catch(e)
{}
if((!classExist)||(alwaysLoad))
{var params="mode=loadClass&className="+className;usesHttp.open("GET","uses.php?mode=loadClass&className="+className,false);usesHttp.send("");if(usesHttp.status==200)
script=usesHttp.responseText;try
{eval("try { "+script+" } catch (e2) {alert('Error loading class ' + className + ' : ' + e2);}");}
catch(e)
{alert('Error loading class '+className+' : '+e);}}}}
else
{}}catch(e){window.messageBoard.alert("Server Connection Failed :Error Loading Class "+className);}}}
window.strToArray=function(str)
{try
{var result=new controls_arrayList();if(str!=undefined)
{uses("controls_arrayList");var lines=str.split("\r\n");var line=undefined;var list=undefined;var first=true;for(var i in lines)
{line=lines[i];line=line.split(";");if(first)
{first=false;}else
{list=new controls_arrayList();for(var j in line)
{list.add(line[j]);}
result.add(list);}}}
return result;}catch(e)
{alert("[strToArray]:"+e);}}
function setTipeButton(tipeButton)
{switch(tipeButton)
{case tbAllFalse:page.activeApplication._mainForm.bSimpan.setEnabled(false);page.activeApplication._mainForm.bEdit.setEnabled(false);page.activeApplication._mainForm.bHapus.setEnabled(false);break;case tbAllTrue:page.activeApplication._mainForm.bSimpan.setEnabled(true);page.activeApplication._mainForm.bEdit.setEnabled(true);page.activeApplication._mainForm.bHapus.setEnabled(true);break;case tbSimpan:page.activeApplication._mainForm.bSimpan.setEnabled(true);page.activeApplication._mainForm.bEdit.setEnabled(false);page.activeApplication._mainForm.bHapus.setEnabled(false);break;case tbUbahHapus:page.activeApplication._mainForm.bSimpan.setEnabled(false);page.activeApplication._mainForm.bEdit.setEnabled(true);page.activeApplication._mainForm.bHapus.setEnabled(true);break;case tbHapus:page.activeApplication._mainForm.bSimpan.setEnabled(false);page.activeApplication._mainForm.bEdit.setEnabled(false);page.activeApplication._mainForm.bHapus.setEnabled(true);break;case tbSimpanHapus:page.activeApplication._mainForm.bSimpan.setEnabled(true);page.activeApplication._mainForm.bEdit.setEnabled(false);page.activeApplication._mainForm.bHapus.setEnabled(true);break;case tbUbah:page.activeApplication._mainForm.bSimpan.setEnabled(false);page.activeApplication._mainForm.bEdit.setEnabled(true);page.activeApplication._mainForm.bHapus.setEnabled(false);break;}}
function LTrim(value)
{if(typeof(value)!="string")return value;var re=/\s*((\S+\s*)*)/;return value.replace(re,"$1");}
function RTrim(value)
{if(typeof(value)!="string")return value;var re=/((\s*\S+)*)\s*/;return value.replace(re,"$1");}
function trim(value)
{return LTrim(RTrim(value));}
window.basicResourceId=1;window.bsNone=0;window.bsAuto=1;window.bsEllips=2;window.bsCheck=3;window.bsDate=4;window.tbAllFalse=0;window.tbSimpan=1;window.tbUbahHapus=2;window.tbHapus=3;window.tbUbah=4;window.tbAllTrue=5;window.tbSimpanHapus=6;window.vtList=0;window.vtTail=1;window.vtIcon=2;window.vtLargeIcon=3;window.cfText=0;window.cfNumeric=1;window.cfNilai=2;window.cfDate=3;window.cfHurufBesar=4;window.ttNormal=0;window.ttNilai=1;window.ttAngka=2;window.ttHurufBesar=3;window.mrOk=1;window.mrCancel=2;window.dateTimeFormat="dd/mm/yyyy";window.decimalSeparator=",";window.thousandSeparator=".";window.alLeft="left";window.alRight="right";window.alCenter="center";window.monthName=new Array();window.monthName["EN"]=new Array();window.monthName["ID"]=new Array();window.monthName["EN"]["01"]="January";window.monthName["EN"]["02"]="Febuary";window.monthName["EN"]["03"]="March";window.monthName["EN"]["04"]="April";window.monthName["EN"]["05"]="May";window.monthName["EN"]["06"]="June";window.monthName["EN"]["07"]="July";window.monthName["EN"]["08"]="Augustus";window.monthName["EN"]["09"]="September";window.monthName["EN"]["10"]="October";window.monthName["EN"]["11"]="November";window.monthName["EN"]["12"]="December";window.monthName["ID"]["01"]="Januari";window.monthName["ID"]["02"]="Febuari";window.monthName["ID"]["03"]="Maret";window.monthName["ID"]["04"]="April";window.monthName["ID"]["05"]="Mei";window.monthName["ID"]["06"]="Juni";window.monthName["ID"]["07"]="Juli";window.monthName["ID"]["08"]="Agustus";window.monthName["ID"]["09"]="September";window.monthName["ID"]["10"]="Oktober";window.monthName["ID"]["11"]="Nopember";window.monthName["ID"]["12"]="Desember";dayName=new Array("Sun","Mon","Tue","Wed","Thu","Fry","Sat");dayLocal=new Array("Minggu","Senin","Selasa","Rabu","Kamis","Jumat","Sabtu");if(document.all)
{try
{usesHttp=new ActiveXObject("Msxml2.XMLHTTP");httpObj=new ActiveXObject("Msxml2.XMLHTTP");}
catch(e)
{try
{usesHttp=new ActiveXObject("Microsoft.XMLHTTP");httpObj=new ActiveXObject("Microsoft.XMLHTTP");}
catch(e2)
{}}}
else
{usesHttp=new XMLHttpRequest();httpObj=new XMLHttpRequest();try
{usesHttp.overrideMimeType('text/javascript');httpObj.overrideMimeType('text/html');}
catch(e)
{}}
function urlencode(str)
{try{{replaceCharArray=new Array();replaceCharArray["%"]="%25";replaceCharArray["\r"]="%0D";replaceCharArray["\n"]="%0A";replaceCharArray["+"]="%2B";replaceCharArray[" "]="+";replaceCharArray["!"]="%21";replaceCharArray['"']="%22";replaceCharArray["#"]="%23";replaceCharArray["$"]="%24";replaceCharArray["&"]="%26";replaceCharArray["'"]="%27";replaceCharArray["("]="%28";replaceCharArray[")"]="%29";replaceCharArray["*"]="%2A";replaceCharArray[","]="%2C";replaceCharArray["/"]="%2F";replaceCharArray[":"]="%3A";replaceCharArray[";"]="%3B";replaceCharArray["<"]="%3C";replaceCharArray["="]="%3D";replaceCharArray[">"]="%3E";replaceCharArray["?"]="%3F";replaceCharArray["@"]="%40";replaceCharArray["["]="%5B";replaceCharArray['\\']="%5C";replaceCharArray["]"]="%5D";replaceCharArray["^"]="%5E";replaceCharArray["`"]="%60";replaceCharArray["{"]="%7B";replaceCharArray["|"]="%7C";replaceCharArray["}"]="%7D";replaceCharArray["~"]="%7E";}
if(typeof(str)=="string")
{var result=new Array();var lgt=str.length;var nowChar="";var replaceStr=undefined;for(var i=0;i<lgt;i++)
{nowChar=str.charAt(i);replaceStr=replaceCharArray[nowChar];if(replaceStr!=undefined)
result.push(replaceStr);else
result.push(nowChar);}
return result.join("");}
else
return str;}catch(e){alert(e);}}
function upDownHtml(html){if(usesHttp!=undefined)
{try{page.activeApplication._mainForm.childBlock.show();uses("server_request");uses("server_util_Map");var request=new server_Request();request.setParams(html);var params="html="+urlencode(request.toXML());usesHttp.open("POST","server/downloadCtrl.php",false);usesHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");usesHttp.setRequestHeader("Content-Length",params.length);usesHttp.send(params);if(usesHttp.status==200)
var result=usesHttp.responseText;else
var result=undefined;page.activeApplication._mainForm.childBlock.hide();return result;}catch(e){window.messageBoard(e);}}}
function checkBrowser()
{var ns=(document.layers)?true:false
var ie=(document.all)?true:false
var app=navigator.appName;var appVers=navigator.appVersion;if(ns)
{appVers=parseInt(appVers,10);if(appVers<5)
return false;}
if(ie)
{if(!confirm("sebaiknya menggunakan browser Mozilla/5.0 (firefox 3)\r\n Mau melanjutkan dengan browser ini?"))
{var vers=parseInt(appVers,10);appVers=appVers.substr(appVers.indexOf("("));appVers=appVers.split(";");for(var i in appVers)
{if(appVers[i].indexOf("MSIE")!=-1)
{appVers=appVers[i].substr(5);appVers=parseInt(appVers,10);if(appVers<7)
return false;}}}}
return true;}
var BrowserDetect={init:function(){this.browser=this.searchString(this.dataBrowser)||"An unknown browser";this.version=this.searchVersion(navigator.userAgent)||this.searchVersion(navigator.appVersion)||"an unknown version";this.OS=this.searchString(this.dataOS)||"an unknown OS";},searchString:function(data){for(var i=0;i<data.length;i++){var dataString=data[i].string;var dataProp=data[i].prop;this.versionSearchString=data[i].versionSearch||data[i].identity;if(dataString){if(dataString.indexOf(data[i].subString)!=-1)
return data[i].identity;}
else if(dataProp)
return data[i].identity;}},searchVersion:function(dataString){var index=dataString.indexOf(this.versionSearchString);if(index==-1)return;return parseFloat(dataString.substring(index+this.versionSearchString.length+1));},dataBrowser:[{string:navigator.userAgent,subString:"Chrome",identity:"Chrome"},{string:navigator.userAgent,subString:"OmniWeb",versionSearch:"OmniWeb/",identity:"OmniWeb"},{string:navigator.vendor,subString:"Apple",identity:"Safari"},{prop:window.opera,identity:"Opera"},{string:navigator.vendor,subString:"iCab",identity:"iCab"},{string:navigator.vendor,subString:"KDE",identity:"Konqueror"},{string:navigator.userAgent,subString:"Firefox",identity:"Firefox"},{string:navigator.vendor,subString:"Camino",identity:"Camino"},{string:navigator.userAgent,subString:"Netscape",identity:"Netscape"},{string:navigator.userAgent,subString:"MSIE",identity:"Explorer",versionSearch:"MSIE"},{string:navigator.userAgent,subString:"Gecko",identity:"Mozilla",versionSearch:"rv"},{string:navigator.userAgent,subString:"Mozilla",identity:"Netscape",versionSearch:"Mozilla"}],dataOS:[{string:navigator.platform,subString:"Win",identity:"Windows"},{string:navigator.platform,subString:"Mac",identity:"Mac"},{string:navigator.platform,subString:"Linux",identity:"Linux"}]};function isFloat(val){if(!val||(typeof val!="string"||val.constructor!=String)){return(false);}
var isNumber=!isNaN(new Number(val));if(isNumber){if(val.indexOf('.')!=-1){return(true);}else{return(false);}}else{return(false);}}
function openFrontEnd(){uses("portal_classess_controls_FEpanel",false,false);uses("portal_classess_controls_FEtabPanel",false,false);uses("portal_classess_controls_FEeventHandler",false,false);uses("portal_classess_controls_FEslider",false,false);uses("portal_classess_controls_FEmenuSlider",false,false);window.compRes=new Array();window.width=document.body.clientWidth||innerWidth;window.ie=document.all?true:false;try{var sc=new controls_FEpanel("panel1");sc.render();sc.setWidth(window.width-10);sc.setHeight(40);sc.setLeft(10);sc.setTop(101);sc.setBgColor("#f5f5f5");}catch(e){alert("error create Front End :"+e);}}
function exit(){return false;}
function showProgress(){window.loading.style.display="";}
function hideProgress(){window.loading.style.display="none";}
function delay(interval){var date=new Date();var curDate=null;do{curDate=new Date();}
while(curDate-date<interval);}